home *** CD-ROM | disk | FTP | other *** search
Text File | 1996-09-17 | 5.4 KB | 186 lines | [TEXT/MPS ] |
- //========================================================================================
- //
- // File: FWDrgDrp.h
- // Release Version: $ ODF 2 $
- //
- // Copyright: (c) 1993 - 1996 by Apple Computer, Inc., all rights reserved.
- //
- //========================================================================================
-
- #ifndef FWDRGDRP_H
- #define FWDRGDRP_H
-
- // ----- Foundation Includes -----
-
- #ifndef FWSTDDEF_H
- #include "FWStdDef.h"
- #endif
-
- #ifndef FWRUNTYP_H
- #include "FWRunTyp.h"
- #endif
-
- // ----- OpenDoc Includes -----
-
- #ifndef FWODTYPS_H
- #include "FWODTyps.h"
- #endif
-
- #ifndef SOM_ODFacet_xh
- #include <Facet.xh>
- #endif
-
- //========================================================================================
- // Forward Declarations
- //========================================================================================
-
- class FW_CPart;
- class FW_CView;
- class FW_CFrame;
- class FW_CMouseEvent;
- class FW_CPoint;
- class FW_CDragCommand;
- class FW_CDropCommand;
- class FW_CDropTracker;
-
- //========================================================================================
- // Constants
- //========================================================================================
-
- typedef short FW_DroppableState;
-
- const FW_DroppableState FW_kNotDroppable = 0x0;
- const FW_DroppableState FW_kFrameDroppable = 0x1;
- const FW_DroppableState FW_kThumbnailDroppable = 0x2;
- const FW_DroppableState FW_kIconDroppable = 0x4;
-
- //========================================================================================
- // class FW_MDraggableFrame
- //========================================================================================
-
- class FW_MDraggableFrame
- {
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructor/Destructors
- //
- protected:
- FW_MDraggableFrame(Environment *ev, FW_CFrame* frame);
-
- public:
- virtual ~ FW_MDraggableFrame();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- virtual FW_CDragCommand* NewDragCommand(Environment *ev,
- FW_CFrame* theFrame,
- const FW_CMouseEvent& theMouseEvent) = 0;
- // You should create an instance of FW_CDragCommand (or a subclass of FW_CDragCommand)
- // Don't forget that if your part support embedding this action must be undoable.
-
- //----------------------------------------------------------------------------------------
- // New API unlikely to be overriden
- //
- public:
- virtual FW_Boolean Drag(Environment* ev,
- const FW_CMouseEvent& theMouseEvent);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CPart* fPart;
- FW_CFrame* fFrame;
- };
-
- //========================================================================================
- // class FW_MDroppableFrame
- //========================================================================================
-
- class FW_MDroppableFrame
- {
- public:
- FW_DECLARE_CLASS
-
- //----------------------------------------------------------------------------------------
- // Constructor/Destructors
- //
- protected:
- FW_MDroppableFrame(Environment *ev, FW_CFrame* frame);
-
- public:
- virtual ~ FW_MDroppableFrame();
-
- //----------------------------------------------------------------------------------------
- // New API
- //
- public:
- virtual FW_CDropCommand* NewDropCommand(Environment *ev,
- FW_CFrame* frame,
- ODDragItemIterator* dropInfo,
- ODFacet* facet,
- const FW_CPoint& dropPoint) = 0;
- // You should create an instance of FW_CDropCommand (or a subclass of FW_CDropCommand)
- // Don't forget that if your part support embedding this action must be undoable.
-
- virtual ODDropResult Drop(Environment *ev,
- ODDragItemIterator* dropInfo,
- ODFacet* facet, const FW_CPoint& where);
-
- virtual ODDragResult CanAcceptDrop(Environment* ev,
- ODDragItemIterator* dragInfo);
-
- virtual ODDragResult DragEnter(Environment* ev,
- ODFacet* facet,
- ODDragItemIterator* dragInfo,
- const FW_CPoint& where);
-
- virtual ODDragResult DragWithin(Environment* ev,
- ODFacet* facet,
- ODDragItemIterator* dragInfo,
- const FW_CPoint& where);
-
- virtual void DragLeave(Environment* ev,
- ODFacet* facet,
- const FW_CPoint& where);
-
- // ----- Drag hilite -----
- virtual ODShape* AcquireDragHiliteShape(Environment* ev, ODFacet* facet);
-
-
- virtual FW_CDropTracker* NewDropTracker(Environment* ev, FW_CView* view, ODFacet* facet);
-
- //----------------------------------------------------------------------------------------
- // Getters/Setters
- //
- public:
- FW_Boolean GetCanAcceptDrop(Environment* ev) const;
-
- FW_CDropTracker* GetDropTracker(Environment* ev) const;
-
- virtual void ChangeDroppableState(Environment* ev, FW_DroppableState droppable);
- FW_DroppableState GetDroppableState(Environment* ev) const;
-
- //----------------------------------------------------------------------------------------
- // Implementation Only API
- //
- public:
- FW_Boolean PrivIsDroppable(Environment* ev) const;
- static FW_Boolean PrivDroppableStateToBoolean(FW_DroppableState droppable, ODTypeToken viewType);
-
- //----------------------------------------------------------------------------------------
- // Data Members
- //
- private:
- FW_CPart* fPart;
- FW_CFrame* fFrame;
- FW_Boolean fCursorInContent;
- FW_Boolean fCanAcceptDrop;
- FW_CDropTracker* fDropTracker;
- };
-
- #endif